package com.inspur.myapplication.dao;

import android.content.Context;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * Created by Administrator on 2020/12/10.
 */

public class OrderDao {
    private Context context;
    public OrderDao(Context context){
        this.context=context;
    }

    public ArrayList queryOrder(String userName){
        ArrayList arrayList=new ArrayList();

        HashMap hashMap=new HashMap();
        hashMap.put("orderDate","2020-12-06");
        hashMap.put("orderMoney","100");
        hashMap.put("orderId","1");
        arrayList.add(hashMap);

        hashMap=new HashMap();
        hashMap.put("orderDate","2020-12-07");
        hashMap.put("orderMoney","200");
        hashMap.put("orderId","2");
        arrayList.add(hashMap);

        return arrayList;
    }

    public ArrayList queryOrderDetail(String orderId){
        ArrayList arrayList=new ArrayList();
        if(orderId.equals("1")){
            HashMap hashMap=new HashMap();
            hashMap.put("goodsName","goods1");
            hashMap.put("goodsPrice","100");
            hashMap.put("goodsImg","https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1541231763,2897362241&fm=26&gp=0.jpg");
            hashMap.put("quantity","1");
            hashMap.put("goodsId","123");
            arrayList.add(hashMap);
        }

        if(orderId.equals("2")){
            HashMap hashMap=new HashMap();
            hashMap.put("goodsName","goods2");
            hashMap.put("goodsPrice","50");
            hashMap.put("goodsImg","https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1541231763,2897362241&fm=26&gp=0.jpg");
            hashMap.put("quantity","1");
            hashMap.put("goodsId","124");
            arrayList.add(hashMap);

            hashMap=new HashMap();
            hashMap.put("goodsName","goods3");
            hashMap.put("goodsPrice","150");
            hashMap.put("goodsImg","https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1541231763,2897362241&fm=26&gp=0.jpg");
            hashMap.put("quantity","1");
            hashMap.put("goodsId","125");
            arrayList.add(hashMap);
        }
        return arrayList;
    }
}
